//
//  SFPNutrientIntakeListCell.swift
//  StriveForPregnancy
//
//  Created by iOS-Czz on 2023/11/9.
//

import UIKit

class SFPNutrientIntakeListCell: UITableViewCell {
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    @IBOutlet var typeIcon: UIImageView!
    
    @IBOutlet var typeLabel: UILabel!
    @IBOutlet var intakeLabel: UILabel!
    @IBOutlet var timeLabel: UILabel!
    @IBOutlet var nameLabel: UILabel!
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: SFPNutrientIntakeModel? {
        didSet {
            self.typeIcon.image = UIImage(named: EAT_TYPE_ICONS[self.model!.type])
            self.typeLabel.text = EAT_TYPES[self.model!.type]
            self.timeLabel.text = "Time: " + self.model!.date
            self.nameLabel.text = self.model?.name
            self.intakeLabel.text = String(format: "%ldg", self.model!.intake)
        }
    }
}
